package my.mybatis.common.util;


import my.mybatis.common.OrderParam;
import my.mybatis.common.QueryParam;
import my.mybatis.common.QueryParams;

/**
 * @Author:wangbin.
 * @Description.
 * @Date:Created in 20:24 2017/9/19.
 * @Modified By:
 */
public class QueryBuildFactory {

    public static QueryParams createQueryParams(Class clazz)
    {
        try {
            return new QueryParams(clazz.newInstance());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public static QueryParam.Builder createQueryParam()
    {
        return new QueryParam.Builder();
    }

    public static OrderParam.Builder createOrderParam()
    {
        return new OrderParam.Builder();
    }

    private QueryBuildFactory(){}

    private static class InnerClass
    {
        private static final QueryBuildFactory CONDITION_AL_PARAMETER_FACTORY = new QueryBuildFactory();
    }

    public static final QueryBuildFactory getInstance()
    {
        return InnerClass.CONDITION_AL_PARAMETER_FACTORY;
    }
}
